<template>
  <el-row class="p-10" :gutter="20">
    <el-col style="display: grid" class="justify-items-stretch" v-if="CurriculumList.length===0" :span="24">
      <p class="justify-self-center">您没有已授权的课程</p>
    </el-col>
    <el-col
        v-for="(item, index) in CurriculumList"
        :span="8"
    >
      <el-card :body-style="{ padding: '0px' }">
        <div style="padding: 14px">
          <span>{{ item.CurriculumYear }}</span>
          <div class="bottom">
<!--            <p v-html="item.CurriculumSeriesDescribe" ></p>-->
            <el-button type="text" @click="toDetail(item)" class="button">进入</el-button>
          </div>
        </div>
      </el-card>
    </el-col>
  </el-row>
</template>

<script>
import axios from "axios";

export default {
  name: "couresDetail",
  created() {

    this.seriesInfo = this.$sestor.getSesWithParse(this.$route.query.resId)
    axios.post("/api/GetOnlyCurriculumsBySeriesId",{
      "series_id":this.seriesInfo.ID,
    }).then((res)=>{
      if (res.status===200){
        this.CurriculumList = res.data
      }
    })
  },
  data(){
    return{
      seriesInfo:{},
      CurriculumList:[]
    }
  },
  methods:{
    toDetail(item){
      // this.$router.push({name:'CurriculumDetail',params:item})
      this.$sestor.pushByNameResId('CurriculumDetail',item)
    }
  }
}
</script>

<style scoped>

</style>